const Score = (teacherLevel = 0) => {
  let level_list = [];
  if (Number(teacherLevel) === 10) {
    // 满星
    for (let i = 0; i < 5; i++) {
      level_list.push(require('../assets/images/starTeacher/star.png'));
    }
  } else if (!Number(teacherLevel)) {
    // 无星
    for (let i = 0; i < 5; i++) {
      level_list.push(require('../assets/images/starTeacher/no_star.png'));
    }
  } else {
    // 存在单个星星
    for (let i = 0; i < parseInt(Number(teacherLevel) / 2, 10); i++) {
      level_list.push(require('../assets/images/starTeacher/star.png'));
    }
    if (Number(teacherLevel) % 2 > 0) {
      level_list.push(require('../assets/images/starTeacher/star1.png'));
    }
    if (level_list.length !== 5) {
      for (let i = 0; i < 5 - level_list.length; i++) {
        level_list.push(require('../assets/images/starTeacher/no_star.png'));
      }
    }
  }
  return level_list;
};

export default Score;
